package main

import (
	"fmt"
	"time"
)

// 考题
// 每秒调用一次panic还不能退出程序

func main() {
	trigger := time.NewTicker(time.Second)

	for {
		select {
		case <-trigger.C:
			go func() {
				defer func() {
					if err := recover(); err != nil {
						fmt.Println("捕获异常:c", err)
					}
				}()
				proc()
			}()
		}
	}
}

func proc() {
	panic("OK ")
}
